/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.boun.cmpe.elele.cotrans.dbOperations;

import com.mysql.jdbc.Connection;
import com.mysql.jdbc.Statement;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.mail.MessagingException;
import mail.SendMail;
import reader.TransFileReader;

/**
 *
 * @author ppt
 */
public class Dummy {

    public static void main(String args[]) {
       /* try {
            DbOperations db = new DbOperations();
            Vector<String> data = db.getUsersActiveTranslations("basak");
            int s = data.size();
            String list = "";
            for (int i = 0; i < s; i++) {
                list = list.concat(data.remove(0));
                list = list.concat("\n");
            }
            System.out.println(list);
            db.getConn().close();
        } catch (SQLException ex) {
            Logger.getLogger(Dummy.class.getName()).log(Level.SEVERE, null, ex);
        }*/

        
        //Integer i=db.insertDocument("docurl", "docpath", 0);
        //System.out.println("id "+i);
        
        //Integer i=db.insertTranslation("paaat", 1,0,0);
        //System.out.println("id "+i);
        //System.out.println(db.getAllUsers().size());
        /*ArrayList<String> a=db.getTransDoc("2");
        System.out.println(a);
        System.out.println(a.get(0));
        System.out.println(a.get(1));*/

        //TransFileReader t= new TransFileReader();
        //t.readPath("C:\\deneme.html");
        //db.insertRating("2", "1", 5);
        /*db.updateTranslationRate("2", "2", "10");
        ArrayList<String> a=db.getTranslationRate("2");
        if(a.size()!=0){
            System.out.println(a.get(0));
            System.out.println(a.get(1));
        }
        db.insertTranslationRate("1","5","5");
         *
         */
        //db.insertUserTranslation("2","1");
        //db.insertUserRate("1", "5", "5");
        //db.updateUserRate("1", "10", "10");
        //System.out.println(db.getUsersOnTrans("1"));
        //db.insertRating("1", "2", "10");

        //String transID = request.getParameter("transID");
String transID="1";
//String username = session.getAttribute("username").toString();
String username="agacho";
//String invited = request.getParameter("person");
String invited="nana";


int i=1;
DbOperations db = new DbOperations();
//String userID = db.getUserID(username).toString();
//String userIDInv = db.getUserID(invited).toString();

//db.insertInvitationInfo(userID, userIDInv, transID);
String []emailTo = {db.getUserMail(invited)};


String subject = "Do you want to make a translation";
String message = username + " invites you to a translation.Please check it from the system!";
SendMail sm = new SendMail();
        try {
            emailTo[0]="aydemirfb@gmail.com";
            sm.SendYourMail(emailTo, subject, message, "cotransbeta@gmail.com");
        } catch (MessagingException ex) {
            Logger.getLogger(Dummy.class.getName()).log(Level.SEVERE, null, ex);
        }

    }
}
